3.15.43 \(\int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx\) [1443]

3.15.43.1 Optimal result
3.15.43.2 Mathematica [A] (verified)
3.15.43.3 Rubi [A] (verified)
3.15.43.4 Maple [A] (verified)
3.15.43.5 Fricas [A] (verification not implemented)
3.15.43.6 Sympy [F]
3.15.43.7 Maxima [A] (verification not implemented)
3.15.43.8 Giac [A] (verification not implemented)
3.15.43.9 Mupad [B] (verification not implemented)

3.15.43.1 Optimal result

Integrand size = 27, antiderivative size = 82 \[ \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {3 a x}{2}+\frac {2 b \cos (c+d x)}{d}-\frac {b \cos ^3(c+d x)}{3 d}+\frac {b \sec (c+d x)}{d}+\frac {3 a \tan (c+d x)}{2 d}-\frac {a \sin ^2(c+d x) \tan (c+d x)}{2 d} \]

output
-3/2*a*x+2*b*cos(d*x+c)/d-1/3*b*cos(d*x+c)^3/d+b*sec(d*x+c)/d+3/2*a*tan(d* 
x+c)/d-1/2*a*sin(d*x+c)^2*tan(d*x+c)/d
 
3.15.43.2 Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00 \[ \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {3 a (c+d x)}{2 d}+\frac {7 b \cos (c+d x)}{4 d}-\frac {b \cos (3 (c+d x))}{12 d}+\frac {b \sec (c+d x)}{d}+\frac {a \sin (2 (c+d x))}{4 d}+\frac {a \tan (c+d x)}{d} \]

input
Integrate[Sin[c + d*x]^2*(a + b*Sin[c + d*x])*Tan[c + d*x]^2,x]
 
output
(-3*a*(c + d*x))/(2*d) + (7*b*Cos[c + d*x])/(4*d) - (b*Cos[3*(c + d*x)])/( 
12*d) + (b*Sec[c + d*x])/d + (a*Sin[2*(c + d*x)])/(4*d) + (a*Tan[c + d*x]) 
/d
 
3.15.43.3 Rubi [A] (verified)

Time = 0.41 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.05, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.370, Rules used = {3042, 3317, 3042, 3070, 244, 2009, 3071, 252, 262, 216}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sin ^2(c+d x) \tan ^2(c+d x) (a+b \sin (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sin (c+d x)^4 (a+b \sin (c+d x))}{\cos (c+d x)^2}dx\)

\(\Big \downarrow \) 3317

\(\displaystyle a \int \sin ^2(c+d x) \tan ^2(c+d x)dx+b \int \sin ^3(c+d x) \tan ^2(c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a \int \sin (c+d x)^2 \tan (c+d x)^2dx+b \int \sin (c+d x)^3 \tan (c+d x)^2dx\)

\(\Big \downarrow \) 3070

\(\displaystyle a \int \sin (c+d x)^2 \tan (c+d x)^2dx-\frac {b \int \left (1-\cos ^2(c+d x)\right )^2 \sec ^2(c+d x)d\cos (c+d x)}{d}\)

\(\Big \downarrow \) 244

\(\displaystyle a \int \sin (c+d x)^2 \tan (c+d x)^2dx-\frac {b \int \left (\cos ^2(c+d x)+\sec ^2(c+d x)-2\right )d\cos (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle a \int \sin (c+d x)^2 \tan (c+d x)^2dx-\frac {b \left (\frac {1}{3} \cos ^3(c+d x)-2 \cos (c+d x)-\sec (c+d x)\right )}{d}\)

\(\Big \downarrow \) 3071

\(\displaystyle \frac {a \int \frac {\tan ^4(c+d x)}{\left (\tan ^2(c+d x)+1\right )^2}d\tan (c+d x)}{d}-\frac {b \left (\frac {1}{3} \cos ^3(c+d x)-2 \cos (c+d x)-\sec (c+d x)\right )}{d}\)

\(\Big \downarrow \) 252

\(\displaystyle \frac {a \left (\frac {3}{2} \int \frac {\tan ^2(c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}-\frac {b \left (\frac {1}{3} \cos ^3(c+d x)-2 \cos (c+d x)-\sec (c+d x)\right )}{d}\)

\(\Big \downarrow \) 262

\(\displaystyle \frac {a \left (\frac {3}{2} \left (\tan (c+d x)-\int \frac {1}{\tan ^2(c+d x)+1}d\tan (c+d x)\right )-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}-\frac {b \left (\frac {1}{3} \cos ^3(c+d x)-2 \cos (c+d x)-\sec (c+d x)\right )}{d}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {a \left (\frac {3}{2} (\tan (c+d x)-\arctan (\tan (c+d x)))-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}-\frac {b \left (\frac {1}{3} \cos ^3(c+d x)-2 \cos (c+d x)-\sec (c+d x)\right )}{d}\)

input
Int[Sin[c + d*x]^2*(a + b*Sin[c + d*x])*Tan[c + d*x]^2,x]
 
output
-((b*(-2*Cos[c + d*x] + Cos[c + d*x]^3/3 - Sec[c + d*x]))/d) + (a*((3*(-Ar 
cTan[Tan[c + d*x]] + Tan[c + d*x]))/2 - Tan[c + d*x]^3/(2*(1 + Tan[c + d*x 
]^2))))/d
 

3.15.43.3.1 Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 244
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand 
Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && IGtQ[p 
, 0]
 

rule 252
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x 
)^(m - 1)*((a + b*x^2)^(p + 1)/(2*b*(p + 1))), x] - Simp[c^2*((m - 1)/(2*b* 
(p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c 
}, x] && LtQ[p, -1] && GtQ[m, 1] &&  !ILtQ[(m + 2*p + 3)/2, 0] && IntBinomi 
alQ[a, b, c, 2, m, p, x]
 

rule 262
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) 
^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ 
(b*(m + 2*p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b 
, c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c 
, 2, m, p, x]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3070
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] 
:> Simp[-f^(-1)   Subst[Int[(1 - x^2)^((m + n - 1)/2)/x^n, x], x, Cos[e + f 
*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]
 

rule 3071
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[b*(ff/f)   Subst[I 
nt[(ff*x)^(m + n)/(b^2 + ff^2*x^2)^(m/2 + 1), x], x, b*(Tan[e + f*x]/ff)], 
x]] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2]
 

rule 3317
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a   Int[(g*Co 
s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[b/d   Int[(g*Cos[e + f*x])^ 
p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]
 
3.15.43.4 Maple [A] (verified)

Time = 0.68 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.96

method result size
parallelrisch \(\frac {20 b \cos \left (2 d x +2 c \right )-\cos \left (4 d x +4 c \right ) b +3 a \sin \left (3 d x +3 c \right )+\left (-36 a x d +64 b \right ) \cos \left (d x +c \right )+27 a \sin \left (d x +c \right )+45 b}{24 d \cos \left (d x +c \right )}\) \(79\)
derivativedivides \(\frac {a \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+b \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d}\) \(104\)
default \(\frac {a \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+b \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d}\) \(104\)
risch \(-\frac {3 a x}{2}-\frac {i a \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {7 b \,{\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {7 b \,{\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {i a \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i a +2 b \,{\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {b \cos \left (3 d x +3 c \right )}{12 d}\) \(117\)
norman \(\frac {\frac {3 a x}{2}-\frac {16 b}{3 d}-\frac {3 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {5 a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {5 a \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {3 a \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+3 a x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 a x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {3 a x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {32 b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(171\)

input
int(sec(d*x+c)^2*sin(d*x+c)^4*(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)
 
output
1/24*(20*b*cos(2*d*x+2*c)-cos(4*d*x+4*c)*b+3*a*sin(3*d*x+3*c)+(-36*a*d*x+6 
4*b)*cos(d*x+c)+27*a*sin(d*x+c)+45*b)/d/cos(d*x+c)
 
3.15.43.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.88 \[ \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {2 \, b \cos \left (d x + c\right )^{4} + 9 \, a d x \cos \left (d x + c\right ) - 12 \, b \cos \left (d x + c\right )^{2} - 3 \, {\left (a \cos \left (d x + c\right )^{2} + 2 \, a\right )} \sin \left (d x + c\right ) - 6 \, b}{6 \, d \cos \left (d x + c\right )} \]

input
integrate(sec(d*x+c)^2*sin(d*x+c)^4*(a+b*sin(d*x+c)),x, algorithm="fricas" 
)
 
output
-1/6*(2*b*cos(d*x + c)^4 + 9*a*d*x*cos(d*x + c) - 12*b*cos(d*x + c)^2 - 3* 
(a*cos(d*x + c)^2 + 2*a)*sin(d*x + c) - 6*b)/(d*cos(d*x + c))
 
3.15.43.6 Sympy [F]

\[ \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right ) \sin ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx \]

input
integrate(sec(d*x+c)**2*sin(d*x+c)**4*(a+b*sin(d*x+c)),x)
 
output
Integral((a + b*sin(c + d*x))*sin(c + d*x)**4*sec(c + d*x)**2, x)
 
3.15.43.7 Maxima [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.91 \[ \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {3 \, {\left (3 \, d x + 3 \, c - \frac {\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} a + 2 \, {\left (\cos \left (d x + c\right )^{3} - \frac {3}{\cos \left (d x + c\right )} - 6 \, \cos \left (d x + c\right )\right )} b}{6 \, d} \]

input
integrate(sec(d*x+c)^2*sin(d*x+c)^4*(a+b*sin(d*x+c)),x, algorithm="maxima" 
)
 
output
-1/6*(3*(3*d*x + 3*c - tan(d*x + c)/(tan(d*x + c)^2 + 1) - 2*tan(d*x + c)) 
*a + 2*(cos(d*x + c)^3 - 3/cos(d*x + c) - 6*cos(d*x + c))*b)/d
 
3.15.43.8 Giac [A] (verification not implemented)

Time = 0.46 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.45 \[ \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {9 \, {\left (d x + c\right )} a + \frac {12 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} + \frac {2 \, {\left (3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 24 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 10 \, b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]

input
integrate(sec(d*x+c)^2*sin(d*x+c)^4*(a+b*sin(d*x+c)),x, algorithm="giac")
 
output
-1/6*(9*(d*x + c)*a + 12*(a*tan(1/2*d*x + 1/2*c) + b)/(tan(1/2*d*x + 1/2*c 
)^2 - 1) + 2*(3*a*tan(1/2*d*x + 1/2*c)^5 - 6*b*tan(1/2*d*x + 1/2*c)^4 - 24 
*b*tan(1/2*d*x + 1/2*c)^2 - 3*a*tan(1/2*d*x + 1/2*c) - 10*b)/(tan(1/2*d*x 
+ 1/2*c)^2 + 1)^3)/d
 
3.15.43.9 Mupad [B] (verification not implemented)

Time = 18.10 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.37 \[ \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {3\,a\,x}{2}-\frac {3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {32\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+3\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {16\,b}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^3} \]

input
int((sin(c + d*x)^4*(a + b*sin(c + d*x)))/cos(c + d*x)^2,x)
 
output
- (3*a*x)/2 - ((16*b)/3 + 3*a*tan(c/2 + (d*x)/2) + 5*a*tan(c/2 + (d*x)/2)^ 
3 + 5*a*tan(c/2 + (d*x)/2)^5 + 3*a*tan(c/2 + (d*x)/2)^7 + (32*b*tan(c/2 + 
(d*x)/2)^2)/3)/(d*(tan(c/2 + (d*x)/2)^2 - 1)*(tan(c/2 + (d*x)/2)^2 + 1)^3)